package com.wgq.TestRongQi;

public class paiXun {
    //冒泡
    public static  void pai_Xu(int[] arr){
        int temp =0;
        for(int j=0;j<arr.length-1;j++){
            for(int i=0;i<arr.length-1-j;i++){
                if(arr[i]<arr[i+1]){
                    temp=arr[i];
                    arr[i]=arr[i+1];
                    arr[i+1]=temp;
                }
            }
        }
    }

    public static void main(String[] args) {
        int[] list={12,21,34,24};
        pai_Xu(list);
        for (int i: list) {
            System.out.print(i+"\t");
        }
    }
}
